package com.web.dao;

import com.web.db.JDBCUtil;
import com.web.javaBean.User;

import java.sql.ResultSet;

public class LoginDao {
    public User selectOne(String username){
        User user = new User();
        try(ResultSet resultSet = JDBCUtil.getInstance().executeQueryRS("select * from borrow_card where username = ?",new Object[]{username})){
            while (resultSet.next()){
                String password = resultSet.getString("password");
                user.setUsername(username);
                user.setPassword(password);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return user;
    }
}
